package org.mapdroid.data.adt;

import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;

public class Client implements Parcelable{
	public static final String LIST = "LIST";
	
	public static final String USERNAME = "USERNAME";
	public static final String PASSWORD = "PASSWORD";
	public static final String NAME = "NAME";
	public static final String SURNAME = "SURNAME";
	public static final String ADDRESS = "ADDRESS";
	public static final String PHONE = "PHONE";
	public static final String MOBILE_PHONE = "MOBILE_PHONE";
	public static final String EMAIL = "EMAIL";
	/*public static final String CREDIT_CARD_NUMBER = "CREDIT_CARD_NUMBER";
	public static final String CREDIT_CARD_EXPIRE_DATE = "CREDIT_CARD_EXPIRE_DATE";
	public static final String CAR_BRAND = "CAR_BRAND";
	public static final String CAR_ID = "CAR_ID";
	public static final String CAR_NAME = "CAR_NAME";*/
	
	private String username;
	private String password;
	private String name;
	private String surname;
	private String address;
	private String phone;
	private String mobilePhone;
	private String email;
	/*private String creditCardNumber;
	private String creditCardExpireDate;
	private String carBrand;
	private String carId;
	private String carName;*/
	
	public Client(	String username,
					String password,
					String name, 
					String surname, 
					String address, 
					String phone,
					String mobilePhone,
					String email/*,
					String creditCardNumber,
					String creditCardExpireDate,
					String carBrand,
					String carName,
					String carId*/){
		this.setUsername(username);
		this.setPassword(password);
		this.setName(name);
		this.setSurname(surname);
		this.setAddress(address);
		this.setPhone(phone);
		this.setMobilePhone(mobilePhone);
		this.setEmail(email);
		/*this.setCreditCardNumber(creditCardNumber);
		this.setCreditCardExpireDate(creditCardExpireDate);
		this.setCarBrand(carBrand);
		this.setCarName(carName);
		this.setCarId(carId);*/
	}

	public Client(Bundle b){
		this.setUsername(b.getString(Client.USERNAME));
		this.setPassword(b.getString(Client.PASSWORD));
		this.setName(b.getString(Client.NAME));
		this.setSurname(b.getString(Client.SURNAME));
		this.setAddress(b.getString(Client.ADDRESS));
		this.setPhone(b.getString(Client.PHONE));
		this.setMobilePhone(b.getString(Client.MOBILE_PHONE));
		this.setEmail(b.getString(Client.EMAIL));
		/*this.setCreditCardNumber(b.getString(Client.CREDIT_CARD_NUMBER));
		this.setCreditCardExpireDate(b.getString(Client.CREDIT_CARD_EXPIRE_DATE));
		this.setCarBrand(b.getString(Client.CAR_BRAND));
		this.setCarName(b.getString(Client.CAR_NAME));
		this.setCarId(b.getString(Client.CAR_ID));*/
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setSurname(String surname) {
		this.surname = surname;
	}

	public String getSurname() {
		return surname;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getAddress() {
		return address;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getPhone() {
		return phone;
	}

	public void setMobilePhone(String mobilePhone) {
		this.mobilePhone = mobilePhone;
	}

	public String getMobilePhone() {
		return mobilePhone;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getEmail() {
		return email;
	}

	/*public void setCreditCardNumber(String creditCardNumber) {
		this.creditCardNumber = creditCardNumber;
	}

	public String getCreditCardNumber() {
		return creditCardNumber;
	}

	public void setCreditCardExpireDate(String creditCardExpireDate) {
		this.creditCardExpireDate = creditCardExpireDate;
	}

	public String getCreditCardExpireDate() {
		return creditCardExpireDate;
	}

	public void setCarBrand(String carBrand) {
		this.carBrand = carBrand;
	}

	public String getCarBrand() {
		return carBrand;
	}

	public void setCarId(String carId) {
		this.carId = carId;
	}

	public String getCarId() {
		return carId;
	}

	public void setCarName(String carName) {
		this.carName = carName;
	}

	public String getCarName() {
		return carName;
	}*/

	public void setUsername(String username) {
		this.username = username;
	}

	public String getUsername() {
		return username;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getPassword() {
		return password;
	}

	@Override
	public int describeContents() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		// TODO Auto-generated method stub
		dest.writeString(this.username);
		dest.writeString(this.password);
		dest.writeString(this.name);
		dest.writeString(this.surname);
		dest.writeString(this.address);
		dest.writeString(this.phone);
		dest.writeString(this.mobilePhone);
		dest.writeString(this.email);
	}
	
	public static final Parcelable.Creator<Client> CREATOR
			= new Parcelable.Creator<Client>(){
		@Override
		public Client createFromParcel(Parcel in) {
			String username = in.readString();
			String password = in.readString();
			String name = in.readString();
			String surname = in.readString();
			String address = in.readString();
			String phone = in.readString();
			String mobilePhone = in.readString();
			String email = in.readString();
			
			return new Client(username, password, name, surname, address, phone, mobilePhone, email);
		}

		@Override
		public Client[] newArray(int size) {
			return new Client[size];
		}
	};
	
}
